#include <iostream>
using namespace std;
int main()
{
    int N,M,X,Y;
    cin>>N>>M>>X>>Y;
    int nMin=X,nMax=X,mMin=Y,mMax=Y;
    
    for(int i = 0; i<N; i++)
    {
        int temp;
        cin>>temp;
        if(temp<nMin)
            nMin = temp;
        if(temp>nMax)
            nMax = temp;
    }
    for(int i = 0; i<M;i++)
    {
        int temp;
        cin>>temp;
        if(temp<mMin)
            mMin = temp;
        if(temp>mMax)
            mMax = temp;
    }
    if(!(nMax<mMin || mMax < nMin))
        cout<<X <<" and "<< Y<<": possible";
    else
        cout<<X << " and "<< Y << ": impossible";
}